<?php
/** @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;

$installer->startSetup();

/**
 * tao bang salestaff_staff
 */
$installer->run("

DROP TABLE IF EXISTS {$this->getTable('mw_simplenews_category')};

CREATE TABLE {$this->getTable('mw_simplenews_category')} (
  `id` int(11) unsigned NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `url_key` varchar(255) NOT NULL default '',
  `status` smallint(6) NOT NULL default '1',
  `store_view` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  `sort_order` int(11) unsigned NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS {$this->getTable('mw_simplenews_news')};

CREATE TABLE {$this->getTable('mw_simplenews_news')} (
  `news_id` int(11) unsigned NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `url_key` varchar(255) NOT NULL default '',
  `status` smallint(6) NOT NULL default '1',
  `category_id` int(11) unsigned NOT NULL ,
  `images` varchar(255) NOT NULL default '',
  `summary` varchar(255) NOT NULL default '',
  `content` text NOT NULL default '',
  PRIMARY KEY (`news_id`),
  FOREIGN KEY (category_id) REFERENCES mw_simplenews_category(id) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

");

$installer->endSetup();